package com.ruoyi.xh.service.impl;

import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.xh.mapper.XhSupplierGoodMapper;
import com.ruoyi.xh.domain.XhSupplierGood;
import com.ruoyi.xh.service.IXhSupplierGoodService;

/**
 * 普通商品Service业务层处理
 * 
 * @author songjw
 * @date 2024-12-13
 */
@Service
public class XhSupplierGoodServiceImpl extends ServiceImpl<XhSupplierGoodMapper,XhSupplierGood> implements IXhSupplierGoodService {

    /**
     * 查询普通商品
     * 
     * @param id 普通商品主键
     * @return 普通商品
     */
    @Override
    public XhSupplierGood selectXhSupplierGoodById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询普通商品列表
     * 
     * @param xhSupplierGood 普通商品
     * @return 普通商品
     */
    @Override
    public Page<XhSupplierGood> selectXhSupplierGoodList(XhSupplierGood xhSupplierGood)
    {
        return new Page<>();
    }

    /**
     * 新增普通商品
     * 
     * @param xhSupplierGood 普通商品
     *
     */
    @Override
    public void insertXhSupplierGood(XhSupplierGood xhSupplierGood)
    {
        this.save(xhSupplierGood);
    }

    /**
     * 修改普通商品
     * 
     * @param xhSupplierGood 普通商品
     *
     */
    @Override
    public void updateXhSupplierGood(XhSupplierGood xhSupplierGood)
    {
        this.updateById(xhSupplierGood);
    }

    /**
     * 批量删除普通商品
     * 
     * @param ids 需要删除的普通商品主键
     *
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteXhSupplierGoodByIds(Long[] ids)
    {
        this.removeByIds(Stream.of(ids).collect(Collectors.toSet()));
    }
}
